package src.util;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

import checkers.quals.DefaultLocation;
import checkers.quals.DefaultQualifier;
import checkers.javari.quals.Mutable;
import checkers.javari.quals.ReadOnly;
import checkers.javari.quals.PolyRead;
import checkers.nullness.quals.NonNull;

@DefaultQualifier(value = "checkers.nullness.quals.NonNull", locations =
{ DefaultLocation.ALL_EXCEPT_LOCALS })
public class MiniSet<E extends /*@Mutable*/Object> implements Iterable<E> {

	private final /*@Mutable*/Set<E> carrier = new HashSet<E>();
	
	public void add(E e) {
		carrier.add(e);
	}

	public Iterator<E> iterator() {
		Iterator<E> iterator = carrier.iterator();
		return iterator;
	}

	public boolean contains(E e)/*@ReadOnly*/{
		return carrier.contains(e);
	}
	
	public String toString() /*@ReadOnly*/ {
		return "I am a MiniSet!";
	}
	
	
}
